﻿using Domain.Entity.ord;
using Domain.IRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Application.SaleReturn_dService
{
    public class SaleReturn_dService : ISaleReturn_dService
    {
        private readonly ISaleReturn_dRepository saleReturn_DRepository;

        public SaleReturn_dService(ISaleReturn_dRepository saleReturn_DRepository)
        {
            this.saleReturn_DRepository = saleReturn_DRepository;
        }


        //添加
        public async Task<int> AddSaleReturn_d(SaleReturn_d saleReturn_D)
        {
            return await saleReturn_DRepository.AddSaleReturn_d(saleReturn_D);
        }


        //删除
        public async Task<int> DeleteSaleReturn_d(int id)
        {
            return await saleReturn_DRepository.DeleteSaleReturn_d(id);
        }


        //根据销售退货单与货品获取到主键id
        public async Task<int> Getid(int saletid, int procid)
        {
            return await saleReturn_DRepository.Getid(saletid, procid);
        }

        //根据销售退货id查询明细
        public async Task<List<SaleReturn_d>> GetSaleReturn_Ds(int saletid)
        {
            return await saleReturn_DRepository.GetSaleReturn_Ds(saletid);
        }


        //更新入库数
        public async Task<int> UpdateNum(int saletid, int oknum, int nonum)
        {
            return await saleReturn_DRepository.UpdateNum(saletid, oknum, nonum);
        }

        //修改
        public async Task<int> UpdateSaleReturn_d(SaleReturn_d saleReturn_D)
        {
            return await saleReturn_DRepository.UpdateSaleReturn_d(saleReturn_D);
        }
    }
}
